# -*- coding:utf-8 -*-
# Author:Ami
# @Time    : 2018/12/2 9:54
# -*- coding:utf-8 -*-
# Author:Ami
# @Time    : 2018/12/1 9:31


class Dog(object):
    def __init__(self, name):
        self.name = name

    def eat(self,food):
        print("%s is eating...%s" % (self.name,food))

def bulk(self):
    print("%s叫" % self.name)
d = Dog("cc")

# choice = input(">>:").strip()

# print(hasattr(d,choice))



names = ["ami","jack"]
data = {}
try:
    # names[3]
    # data['name']
    pass
# except (KeyError,IndexError) as e: #e是详情信息
#     print("没有这个key值",e)
# except Exception as e: #不建议用
#     print('出错了',e)
# except IndexError as e:
#     print('列表操作错误',e)

except Exception as e:
    print("未知错误",e)

else:
    print('一切正常')
finally:
    print("不管有没有错")